package com.fowo.api.model.receipt;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import com.fowo.api.common.excel.ImageConvert;
import com.fowo.api.common.validator.EnumsString;
import com.fowo.api.sys.entity.SysFile;
import java.util.List;
import javax.validation.constraints.*;
import lombok.Getter;
import lombok.Setter;

/** 收货单 导入导出辅助模型 */
@Getter
@Setter
public class ReceiptExcelPo {

  @NotNull(message = "收货单号不能为空")
  @Size(max = 50, message = "收货单号长度不能超过20")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "*收货单号")
  private String orderSn;

  @EnumsString(
    value = { " 采购订单", " 委外订单" },
    message = "收货类型的可用值为 “ 采购订单”, “ 委外订单” 其中之一"
  )
  @Size(max = 50, message = "收货类型长度不能超过20")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "收货类型")
  private String receiptType;

  @NotNull(message = "关联单据号不能为空")
  @Size(max = 50, message = "关联单据号长度不能超过20")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "*关联单据号")
  private String docRelatePurchaseOrderCode;

  @ExcelIgnore
  @ExcelProperty(value = "*关联单据号")
  private Long docRelate;

  @NotNull(message = "仓库不能为空")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "*仓库")
  private String warehouseName;

  @ExcelIgnore
  @ExcelProperty(value = "*仓库")
  private Long warehouse;

  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "供应商")
  private String supplierSupplierName;

  @ExcelIgnore
  @ExcelProperty(value = "供应商")
  private Long supplier;

  @DateTimeFormat("yyyy年MM月dd日HH:mm:ss")
  @ExcelProperty(value = "预计到货时间")
  private java.util.Date arrivalGoodDate;

  @Size(max = 50, message = "物流商长度不能超过20")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "物流商")
  private String shipmentEnterpriseName;

  @ExcelIgnore
  @ExcelProperty(value = "物流商")
  private Long shipmentEnterprise;

  @Size(max = 50, message = "物流单号长度不能超过20")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "物流单号")
  private String logisticsCode;

  @Size(max = 50, message = "采购员长度不能超过20")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "采购员")
  private String buyerName;

  @ExcelIgnore
  @ExcelProperty(value = "采购员")
  private Long buyer;

  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "收货人")
  private String consigneeName;

  @ExcelIgnore
  @ExcelProperty(value = "收货人")
  private Long consignee;

  @DateTimeFormat("yyyy年MM月dd日HH:mm:ss")
  @ExcelProperty(value = "收货时间")
  private java.util.Date receiptDate;

  @Size(max = 50, message = "备注长度不能超过20")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "备注")
  private String remarks;

  @EnumsString(
    value = { "待收货", "已完成" },
    message = "单据状态的可用值为 “待收货”, “已完成” 其中之一"
  )
  @Size(max = 50, message = "单据状态长度不能超过20")
  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "单据状态")
  private String status;

  @ContentStyle(
    horizontalAlignment = HorizontalAlignmentEnum.LEFT,
    dataFormat = 49
  )
  @ExcelProperty(value = "加急")
  private String urgent;

  @ExcelProperty(value = "通知收货量")
  private Integer notificationOfReceiptQuantity;

  @ExcelProperty(value = "收货量")
  private Integer receiptAboutQuantity;

  @ExcelProperty(value = "收货产品", converter = ImageConvert.class)
  private List<SysFile> receiptAboutProduct;
}
